<LayoutEditFormBox :loading="load">

    <template slot="main">
        <el-form ref="editForm" :model="form" label-width="155px" label-position="left">
            <LayoutCell>
                <LayoutCellItem title="基础设置">
                    <el-form-item label="appKey">
                        <el-input v-model="form.app_key" style="width: 50%;"></el-input>
                    </el-form-item>

                    <el-form-item label="appSecret">
                        <el-input v-model="form.app_secret" style="width: 50%;"></el-input>
                    </el-form-item>

                    <el-form-item label="回调地址">
                        <el-input v-model="form.callback_url" style="width: 50%;"></el-input>
                    </el-form-item>
                </LayoutCellItem>

                <LayoutCellItem title="更新设置">
                    <el-form-item label="自动更新商品售价">
                        <el-radio-group v-model="form.is_auto_sale_price">
                            <el-radio :label="1">开启</el-radio>
                            <el-radio :label="0">关闭</el-radio>
                        </el-radio-group>
                    </el-form-item>

                    <el-form-item label="自动更新商品成本价">
                        <el-radio-group v-model="form.is_auto_original_price">
                            <el-radio :label="1">开启</el-radio>
                            <el-radio :label="0">关闭</el-radio>
                        </el-radio-group>
                    </el-form-item>

                    <el-form-item label="自动更新商品基本信息">
                        <el-radio-group v-model="form.is_auto_product">
                            <el-radio :label="1">开启</el-radio>
                            <el-radio :label="0">关闭</el-radio>
                        </el-radio-group>
                    </el-form-item>

                    <el-form-item label="自动更新商品主图">
                        <el-radio-group v-model="form.is_auto_product_pic">
                            <el-radio :label="1">开启</el-radio>
                            <el-radio :label="0">关闭</el-radio>
                        </el-radio-group>
                    </el-form-item>

                    <el-form-item label="去掉水印">
                        <el-radio-group v-model="form.is_watermark">
                            <el-radio :label="1">开启</el-radio>
                            <el-radio :label="0">关闭</el-radio>
                        </el-radio-group>
                    </el-form-item>

                    <el-form-item label="创建品牌">
                        <el-radio-group v-model="form.is_auto_brand">
                            <el-radio :label="1">开启</el-radio>
                            <el-radio :label="0">关闭</el-radio>
                        </el-radio-group>
                    </el-form-item>

                    <el-form-item label="使用供应链中台定价">
                        <el-radio-group v-model="form.is_use_stbz_price">
                            <el-radio :label="1">开启</el-radio>
                            <el-radio :label="0">关闭</el-radio>
                        </el-radio-group>
                    </el-form-item>
                </LayoutCellItem>

                <LayoutCellItem title="定价策略" v-if="form.is_use_stbz_price == 0">
                    <div v-for="item in form.price_strategy">
                        <el-form-item :label="setText(item.source) + (item.priceType == 1 ? '销售价' : '成本价') + ' 定价策略'">
                            <el-radio-group v-model="item.policyType">
                                <el-radio :label="1" v-if="item.priceType == 1">指导价 x 定价系数</el-radio>
                                <el-radio :label="2">协议价 x 定价系数</el-radio>
                                <el-radio :label="3">营销价 x 定价系数</el-radio>
                            </el-radio-group>
                            <el-input v-model="item.policyRatio" style="width: 200px;margin-left: 20px;"><template slot="append">%</template></el-input>
                        </el-form-item>
                    </div>
                </LayoutCellItem>

                <LayoutCellItem title="风控策略">
                    <div slot="option">
                        触发风控策略会把商品库存设为零
                    </div>
                    <el-form-item label="风控策略">
                        <el-radio-group v-model="form.risk_strategy">
                            <el-radio :label="1">产品售价 < 成本价</el-radio>
                            <el-radio :label="2">利润率 < 设定利润率</el-radio>
                        </el-radio-group>
                    </el-form-item>

                    <el-form-item label="利润率" v-if="form.risk_strategy == 2">
                        <el-input v-model="form.risk_ratio" style="width: 50%;"><template slot="append">%</template></el-input>
                    </el-form-item>
                </LayoutCellItem>

                <LayoutCellItem title="订单策略">
                    <el-form-item label="运费设定">
                        <el-radio-group v-model="form.freight_type">
                            <el-radio :label="1">供应链运费</el-radio>
                            <el-radio :label="2">商品自设运费</el-radio>
                        </el-radio-group>
                    </el-form-item>
                </LayoutCellItem>
            </LayoutCell>
        </el-form>
    </template>
    <template slot="footer">
        <el-button type="primary" @click="sum()">确定</el-button>
    </template>

</LayoutEditFormBox>